<?php
namespace Modules\UI\Http\Controllers\Admin\V1;

use Illuminate\Http\Request;
use Illuminate\Routing\Controller;

use Setting;
use Validator;
use ThrowException;
use DB;

class PathController extends Controller
{
    // 小程序常用路径列表 
    public function index(Request $req)
    {
        $rule = [
        ];
        Validator::make($req->all(), $rule)->fails() && ThrowException::BadRequest(); 

        $list = [
            '首页' => '/pages/index/index',
            '商城页' => '/pages/shop/index',
            '论坛页' => '/pages/topic/index',
            '我的' => '/pages/center/index',
            '我的盒柜' => '/pages/myBox/index',
            '预售日历' => '/pages/presell/index',
            '购物车' => '/pages/cart/index',
            '分类页' => '/pages/category/index',
            '每日任务页' => '/pages/dayTask/index',
            '我的活动列表' => '/pages/myActivity/index',
            '我的地址页' => '/pages/myAddress/index',
            '我的订单' => '/pages/orderList/index',
            '我的邀请' => '/pages/myInvitees/index',
            '我的积分记录' => '/pages/myScore/index',
            '我的红包记录' => '/pages/myRedpack/index',
            '盲盒规则' => '/pages/rule/index?type=box',
            '一番赏规则' => '/pages/rule/index?type=yifanshang',
            '邀请有礼活动规则' => '/pages/rule/index?type=share'
        ];

        $res = [];
        foreach ($list as $key => $value) {
            array_push($res, [
                'title' => $key,
                'path' => $value
            ]);
        }

        return [
            'list' => $res
        ];
    }
}
